
import pandas as pd
import model.stock_index as stock_index

idxList = []
idxList.append(stock_index.StockIndex("000001", "上证指数"))
idxList.append(stock_index.StockIndex("000002", "深证指数"))

names, codes = [], []
for idx in idxList:
    names.append(idx.name)
    codes.append(idx.code)

df = pd.DataFrame()
df['name'] = names
df['code'] = codes

print(df)